YES 0.857
H-Termination proof of /home/matraf/haskell/eval_FullyBlown_Fast/Monad.hs
H-Termination of the given Haskell-Program with start terms could successfully be proven:
↳ HASKELL
↳ LR
mainModule Monad
| ((replicateM :: Int -> IO a -> IO [a]) :: Int -> IO a -> IO [a]) |
module Monad where
| import qualified Maybe import qualified Prelude
|
| replicateM :: Monad a => Int -> a b -> a [b]
replicateM | n x | = | sequence (replicate n x) |
|
module Maybe where
| import qualified Monad import qualified Prelude
|
Lambda Reductions:
The following Lambda expression
\xs→return (x : xs)
is transformed to
sequence0 | x xs | = return (x : xs) |
The following Lambda expression
\x→sequence cs >>= sequence0 x
is transformed to
sequence1 | cs x | = sequence cs >>= sequence0 x |
↳ HASKELL
↳ LR
↳ HASKELL
↳ BR
mainModule Monad
| ((replicateM :: Int -> IO a -> IO [a]) :: Int -> IO a -> IO [a]) |
module Maybe where
| import qualified Monad import qualified Prelude
|
module Monad where
| import qualified Maybe import qualified Prelude
|
| replicateM :: Monad b => Int -> b a -> b [a]
replicateM | n x | = | sequence (replicate n x) |
|
Replaced joker patterns by fresh variables and removed binding patterns.
↳ HASKELL
↳ LR
↳ HASKELL
↳ BR
↳ HASKELL
↳ COR
mainModule Monad
| ((replicateM :: Int -> IO a -> IO [a]) :: Int -> IO a -> IO [a]) |
module Monad where
| import qualified Maybe import qualified Prelude
|
| replicateM :: Monad a => Int -> a b -> a [b]
replicateM | n x | = | sequence (replicate n x) |
|
module Maybe where
| import qualified Monad import qualified Prelude
|
Cond Reductions:
The following Function with conditions
is transformed to
undefined0 | True | = undefined |
undefined1 | | = undefined0 False |
The following Function with conditions
take | n vx | |
take | vy [] | = [] |
take | n (x : xs) | = x : take (n - 1) xs |
is transformed to
take | n vx | = take3 n vx |
take | vy [] | = take1 vy [] |
take | n (x : xs) | = take0 n (x : xs) |
take0 | n (x : xs) | = x : take (n - 1) xs |
take1 | vy [] | = [] |
take1 | ww wx | = take0 ww wx |
take2 | n vx True | = [] |
take2 | n vx False | = take1 n vx |
take3 | n vx | = take2 n vx (n <= 0) |
take3 | wy wz | = take1 wy wz |
↳ HASKELL
↳ LR
↳ HASKELL
↳ BR
↳ HASKELL
↳ COR
↳ HASKELL
↳ LetRed
mainModule Monad
| ((replicateM :: Int -> IO a -> IO [a]) :: Int -> IO a -> IO [a]) |
module Maybe where
| import qualified Monad import qualified Prelude
|
module Monad where
| import qualified Maybe import qualified Prelude
|
| replicateM :: Monad a => Int -> a b -> a [b]
replicateM | n x | = | sequence (replicate n x) |
|
Let/Where Reductions:
The bindings of the following Let/Where expression
are unpacked to the following functions on top level
repeatXs | xu | = xu : repeatXs xu |
↳ HASKELL
↳ LR
↳ HASKELL
↳ BR
↳ HASKELL
↳ COR
↳ HASKELL
↳ LetRed
↳ HASKELL
↳ NumRed
mainModule Monad
| ((replicateM :: Int -> IO a -> IO [a]) :: Int -> IO a -> IO [a]) |
module Monad where
| import qualified Maybe import qualified Prelude
|
| replicateM :: Monad a => Int -> a b -> a [b]
replicateM | n x | = | sequence (replicate n x) |
|
module Maybe where
| import qualified Monad import qualified Prelude
|
Num Reduction: All numbers are transformed to thier corresponding representation with Pos, Neg, Succ and Zero.
↳ HASKELL
↳ LR
↳ HASKELL
↳ BR
↳ HASKELL
↳ COR
↳ HASKELL
↳ LetRed
↳ HASKELL
↳ NumRed
↳ HASKELL
↳ Narrow
mainModule Monad
| (replicateM :: Int -> IO a -> IO [a]) |
module Maybe where
| import qualified Monad import qualified Prelude
|
module Monad where
| import qualified Maybe import qualified Prelude
|
| replicateM :: Monad b => Int -> b a -> b [a]
replicateM | n x | = | sequence (replicate n x) |
|
Haskell To QDPs
↳ HASKELL
↳ LR
↳ HASKELL
↳ BR
↳ HASKELL
↳ COR
↳ HASKELL
↳ LetRed
↳ HASKELL
↳ NumRed
↳ HASKELL
↳ Narrow
↳ QDP
↳ DependencyGraphProof
Q DP problem:
The TRS P consists of the following rules:
new_sequence1(Succ(xv3000), xv4, xv5, h) → new_sequence(xv3000, xv4, h)
new_sequence(Succ(xv3000), xv4, h) → new_sequence(xv3000, xv4, h)
R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.
↳ HASKELL
↳ LR
↳ HASKELL
↳ BR
↳ HASKELL
↳ COR
↳ HASKELL
↳ LetRed
↳ HASKELL
↳ NumRed
↳ HASKELL
↳ Narrow
↳ QDP
↳ DependencyGraphProof
↳ QDP
↳ QDPSizeChangeProof
Q DP problem:
The TRS P consists of the following rules:
new_sequence(Succ(xv3000), xv4, h) → new_sequence(xv3000, xv4, h)
R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem. From the DPs we obtained the following set of size-change graphs:
- new_sequence(Succ(xv3000), xv4, h) → new_sequence(xv3000, xv4, h)
The graph contains the following edges 1 > 1, 2 >= 2, 3 >= 3